
package JackCompiler;
public class VarDetails {
	
	private String name;
	private String type;
	private int kind;
	private int index;
	
	public VarDetails(){}
	
	public VarDetails(VarDetails other){
		this.name = other.name;
		this.type = other.type;
		this.kind = other.kind;
	}
	
	public VarDetails(String name, String type, int kind){
		this.name = name;
		this.type = type;
		this.kind = kind;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getKind() {
		return kind;
	}

	public void setKind(int kind) {
		this.kind = kind;
	}

	public int getIndex() {
		return index;
	}

	public void setPosition(int position) {
		this.index = position;
	}
	
	public String toString(){
		String kindStr = "";
		if(kind == SymbolTable.STATIC) kindStr = "static";
		if(kind == SymbolTable.FIELD) kindStr = "field";
		if(kind == SymbolTable.ARG) kindStr = "argument";
		if(kind == SymbolTable.VAR) kindStr = "local";
		return name + "\t\t" + type + "\t\t" + kindStr + "\t\t" + index;
	}
}
